'use strict'

/**
 * 实用工具类模块
 */

module.exports = ({ router, controller, io, config }) => {
  const NAMESPACE = `${config.apiPath}/common`
  const subRouter = router.namespace(NAMESPACE)
  const Post = subRouter.post
  const Get = subRouter.get
  const { common } = controller
  const { oss, verify, publicData, utils } = common

  /**
   * 阿里云云存储
   */
  Post('/get_oss_url', oss.GetOssUrl)

  Post('/get_oss_post_object_params', oss.GetOssPostObjectParams)

  Post('/send_verify', verify.SendVerify)

  // 创建默认数据
  Post('/create_default_menus_table', utils.CreateDefaultTable)
  // 创建默认考试试题
  Post('/create_default_question_table', utils.CreateDefaultQuestionTable)

  // 批量上传违章
  Post('/upload', utils.upload)
  // 批量上传车
  Post('/uploadCar', utils.uploadCar)
}
